import request from '@/request/request.js';

// 获取工单列表
export const getOrderList = (data) => {
  return request({
    url: '/customer/app/work/order/list',
    method: 'get',
    data
  })
}

// 获取维保项目列表
export const projectList = (data)=>{
	return request({
		url:`/customer/app/work/order/projectList`,
		method:'get',
		data:data
	})
}

// 获取工单不合格检查记录列表
export const orderNoPassList = (data) => {
  return request({
    url: '/customer/app/work/order/untreated/records',
    method: 'get',
    data
  })
}

// 获取系统列表
export const orderSystemList = (projectId) => {
  return request({
    url: `/customer/app/work/order/systemList/${projectId}`,
    method: 'get',
  })
}

// 获取设备列表
export const orderDeviceList = (systemId) => {
  return request({
    url: `/customer/app/work/order/deviceList/${systemId}`,
    method: 'get',
  })
}

// 获取地点列表
export const orderEdificeList = (projectId) => {
  return request({
    url: `/customer/app/work/order/buildingFloorList/${projectId}`,
    method: 'get',
  })
}

// 新增工单
export const addOrder = (data) => {
  return request({
    url: '/customer/app/work/order',
    method: 'post',
    data
  })
}

// 编辑工单
export const editOrder = (data) => {
  return request({
    url: `/customer/app/work/order`,
    method: 'put',
    data
  })
}

// 获取工单详情
export const getOrderDetail = (id) => {
  return request({
    url: `/customer/app/work/order/${id}`,
    method: 'get',
  })
}

// 获取评论列表
export const commentList = (id,data) => {
  return request({
    url: `/customer/app/work/order/comment/list/${id}`,
    method: 'get',
    data
  })
}

// 新增工单评论列表
export const addComment = (data) => {
  return request({
    url: `/customer/app/work/order/comment`,
    method: 'post',
		data
  })
}

// 获取工单附件列表
export const getWorkOrderAnnex = (id) => {
  return request({
    url: `/customer/app/contract/annex/getWorkOrderAnnex/${id}`,
    method: 'get',
  })
}

// 工单操作记录动态列表
export const getOrderStepRecord = (data) => {
  return request({
    url: `/customer/app/workOrder/record/list`,
    method: 'get',
    data
  })
}

// 工单操作记录
export const addOrderRecord = (data) => {
  return request({
    url: `/customer/app/workOrder/record`,
    method: 'post',
    data
  })
}

// 获取用户列表
export const getOrderUserList = (id) => {
  return request({
    url: `/customer/app/workOrder/record/informUserList/${id}`,
    method: 'get',
  })
}

// 获取项目负责人
export const getOrderProjectLeader = (id) => {
  return request({
    url: `/customer/app/workOrder/record/projectLeader/${id}`,
    method: 'get',
  })
}

// 检测是否可操作工单
export const isOperate = (data) => {
  return request({
    url: `/customer/app/work/order/isOperate`,
    method: 'get',
    data
  })
}